package com.example.aerospacemanagementsystem.controller.logistics;


import com.example.aerospacemanagementsystem.entity.logistics.Item;
import com.example.aerospacemanagementsystem.entity.logistics.Safety;
import com.example.aerospacemanagementsystem.service.logisticsService.impl.SafetyService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 * @author 李铭
 */

@Api(tags = "劳保订单")
@RestController
@CrossOrigin
@RequestMapping("/safety")
public class SafetyController {
    @Autowired
    private SafetyService safetyService;

    @PostMapping
    public int add(@RequestBody Safety safety){
        return safetyService.add(safety);
    }

    @DeleteMapping
    public int delete(Safety safety){
        return safetyService.delete(safety);
    }

    @PutMapping
    public int update(@RequestBody Safety safety){
        return safetyService.update(safety);
    }

    @GetMapping("/getAll")
    public List<Safety> getAllCity(Safety safety) {
        List<Safety> list = safetyService.getAllSafety(safety);
        return list;
    }
}
